package com.sigmazero13.MKDummy.activites;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import com.sigmazero13.MKDummy.R;

public class HelpActivity extends Activity {
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.help);
	}

	public void onClickHelp (View v) {
		int id = v.getId();
		int textId = -1;
		
		switch (id) {
		case R.id.help_setup_button:
			textId = R.string.help_setup_content;
			break;
		case R.id.help_playing_button:
			textId = R.string.help_playing_content;
			break;
		default:
				break;
		}
		
		if (textId >= 0) {
			startInfoActivity(textId);
		} else {
			Toast.makeText(this, "Help not available!", Toast.LENGTH_SHORT).show();
		}
	}
	
	
	private void startInfoActivity(int textId) {
		Intent intent = new Intent(this, TopicActivity.class);
		intent.putExtra(TopicActivity.ARG_TEXT_ID, textId);
		startActivity(intent);
	}
}
